package tw.com.diray.comm.ui;

import tw.com.diary.ae.com.Msg;
import tw.com.dirary.comm.R;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

/**
 * 訊息
 * @author Andy
 *
 */
public class MessageToast extends GenericToastModel {

	@Override
	protected void create(String code,String message) {
		final Toast toast = this.getToast();
		toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);

		final LayoutInflater inflater = (LayoutInflater) this.getContext()
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		final View layout = inflater.inflate(R.layout.toast_view, null);

		TextView exCode = (TextView) layout.findViewById(R.id.exCode);
		TextView exMsg = (TextView) layout.findViewById(R.id.exMsg);

		exCode.setText("[" + code + "]" + "\n");
		exMsg.setText(message);

		toast.setView(layout);
		
	}

}
